#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time      :2022/5/20 10:51
# @Author    :cjw
import logging

from selenium.webdriver.common.by import By

from web_wework.page.base_page import BasePage


class MainPage(BasePage):
	"""企业微信主页面"""

	__BTN_CONTACT = (By.XPATH, '//span[text()="通讯录"]')  # 通讯录按钮
	__BTN_ADD_MEMBER = (By.XPATH, '//span[text()="添加成员"]')  # 添加成员按钮

	def goto_contact(self):
		"""跳转到通讯录页面"""
		from web_wework.page.contact_page import ContactPage

		logging.info('跳转到通讯录页面')
		self.click(self.__BTN_CONTACT)
		return ContactPage(self.driver)

	def goto_add_member(self):
		"""跳转到添加成员页面"""
		from web_wework.page.add_member_page import AddMemberPage

		logging.info('跳转到添加成员页面')
		self.click(self.__BTN_ADD_MEMBER)
		return AddMemberPage(self.driver)
